package com.lalameow.researchstation

import com.lalameow.researchstation.screen.ResearchStationScreenHandler
import com.lalameow.researchstation.screen.registerResearchStationScreen
import net.fabricmc.api.EnvType
import net.fabricmc.api.Environment
import net.minecraft.screen.ScreenHandlerType
import net.minecraft.util.registry.Registry

internal fun ResearchStation.registerScreens() = with(Screens) {
    Registry.register(
        Registry.SCREEN_HANDLER,
        Identifiers.RESEARCH_STATION,
        RESEARCH_STATION
    )
}

@Environment(EnvType.CLIENT)
internal fun ResearchStation.registerScreensClient() = with(Screens) {
    registerResearchStationScreen()
}

val ResearchStation.screens: Screens
    get() = Screens

object Screens {
    val RESEARCH_STATION = ScreenHandlerType(::ResearchStationScreenHandler)
}
